<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Http\Response;

class CookieController extends Controller {
	/**
	 * cookie的例子
	 * @param  Request $request [description]
	 * @return [type]           [description]
	 */
	public function index(Request $request) {
		$response = new Response("hello world!(with cookie)");

		$response->withCookie(cookie("cookiename", "cookievalue"));
		return $response;
	}

	/*
		获取cookie
	*/
	public function getcookie(Request $request) {
		$cookie = $request->cookie("cookiename");
		echo $cookie;
	}
}
